using System;

namespace ZeBobo5.LibraryHelper.Orm
{
    public class OrmDataLink<A, B> : IOrmDataLink
        where A : IOrmDataElementBase
        where B : IOrmDataElementBase
    {
        private readonly OrmFieldBase<A> _fieldA;
        private readonly OrmFieldBase<B> _fieldB;

        public OrmDataLink(OrmFieldBase<A> fieldA, OrmFieldBase<B> fieldB)
        {
            _fieldA = fieldA;
            _fieldB = fieldB;
        }

        public OrmFieldBase<A> FieldA
        {
            get { return _fieldA; }
        }

        public OrmFieldBase<B> FieldB
        {
            get { return _fieldB; }
        }

        #region IOrmDataLink Members

        public Type TypeOfA
        {
            get { return typeof (A); }
        }

        public Type TypeOfB
        {
            get { return typeof (B); }
        }

        #endregion
    }
}